package com.easy.west.westclient.api.department.api;

import com.easy.west.westclient.api.department.bean.AllDepartMentBean;
import com.easy.west.westclient.api.department.bean.DepartMentBean;
import com.easy.west.westclient.api.department.bean.DepartMentInfo;
import com.easy.west.westclient.api.department.bean.DepartMentList;

import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;

/**
 * 部门service
 * Created by xiatao on 2018/8/15.
 */

public interface DepartMentService
{
    /***
     * 查找一个部门详情
     * @param did
     * @return
     */
    @GET("departments/getDep/{did}")
    Call<DepartMentInfo> findoneDepartMentInfo(@Path("did") long did);
    /**
     * 查询所有部门包括1 2.....n级
     */
    @GET("departments/findall")
    Call<AllDepartMentBean> findAllDepartMent();

    /**
     * 查询1级
     * @return
     */
    @GET("departments/parentdep")
    Call<DepartMentList> findoneClassDepartMent();

    /**
     * 在1级部门下查找2级部门
     * @param fid
     * @return
     */
    @GET("departments/findbyfid/{fid}")
    Call<DepartMentList> findOtherClassDepartMent(@Path("fid")long fid);

    /***
     * 搜索部门
     * @param name
     * @return
     */
    @FormUrlEncoded()
    @POST("departments/like")
    Call<DepartMentList> queryDepartment(@Field("depname")String name);
}
